package com.googlechinaservice.biz;

import java.util.List;

import javax.persistence.EntityManager;

import com.googlechinaservice.dao.ManagerDao;
import com.googlechinaservice.entity.Manager;
import com.googlechinaservice.util.EntityManagerHelper;

public class ManagerBiz {
	private ManagerDao md = new ManagerDao();
	
	public void add(Manager man){
		EntityManager em = EntityManagerHelper.getEntityManager();
		em.getTransaction().begin();
		md.save(man);
		em.getTransaction().commit();
		em.close();
	}
	
	public List<Manager> findByAll(){
		List<Manager> ms = md.findAll();
		return ms;
	}
}
